//
//  ListCellTableViewCell.swift
//  coredataTest
//
//  Created by xuNick on 16/11/10.
//  Copyright © 2016年 NN. All rights reserved.
//

import UIKit

class ListCellTableViewCell: UITableViewCell {

    @IBOutlet weak var TimeLabel: UILabel!
    @IBOutlet weak var MagnitudeLabel: UILabel!
    @IBOutlet weak var LocationLabel: UILabel!
    
    var model: Quake? {
        didSet{
            TimeLabel.text = dateFormatter.string(from: model?.time as! Date)
            MagnitudeLabel.text = "\(model?.magnitude ?? 0)"
            LocationLabel.text = model?.placeName
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    lazy private var dateFormatter:DateFormatter = {
        let formatter = DateFormatter()
        formatter.dateFormat = "yyyy.MM.dd"
        return formatter
    }()

    
}
